package factory.abstract1;

public class Consumer {
    public static void main(String[] args) {
        AbstractFactory apple=new AppleFactory();
        AbstractFactory xiaomi=new XiaoMiFactory();

        System.out.println("-----------苹果工厂-----------");
        Phone applePhone=apple.producePhone();
        Router appleRouter=apple.produceRouter();
        applePhone.open();
        applePhone.close();

        appleRouter.openWIFI();
        appleRouter.closeWIFI();


        System.out.println("-----------小米工厂-----------");
        Phone xiaomiPhone=xiaomi.producePhone();
        Router xiaomiRouter=xiaomi.produceRouter();
        xiaomiPhone.open();
        xiaomiPhone.close();

        xiaomiRouter.openWIFI();
        xiaomiRouter.closeWIFI();

    }




}
